package com.yami.shop.multishop.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yami.shop.bean.model.MeltCloudUltraGroupCost;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.MeltCloudUltraGroupCostService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shop/ultra/group/cost")
@Tag(name = "融云用户管理")
@AllArgsConstructor
public class MeltCloudUltraGroupCostController {

    private final MeltCloudUltraGroupCostService ultraGroupCostService;


    @GetMapping("/list")
    @Operation(summary =  "获取超级群聊资费标准", description = "获取超级群聊资费标准")
    public ServerResponseEntity<List<MeltCloudUltraGroupCost>> list(){
        List<MeltCloudUltraGroupCost> list = ultraGroupCostService.list(Wrappers.lambdaQuery(MeltCloudUltraGroupCost.class)
                .eq(MeltCloudUltraGroupCost::getIsHide, 0).eq(MeltCloudUltraGroupCost::getIsDel, 0).orderByAsc(MeltCloudUltraGroupCost::getMonths).orderByAsc(MeltCloudUltraGroupCost::getEnergyValue));
        return ServerResponseEntity.success(list);
    }




}
